﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/OneColumn.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SharingCenter.Web.Mod.Groups.Manage.Default" %>
<%@ Register Src="~/Mod/Groups/Manage/ManageNav.ascx" TagName="nav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
管理圈子
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
 <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Mod/Groups/CreateGroup.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    <myuc:GroupHeader ID="GroupHeader1" runat="server" GroupIdQueryStringField="id" />
    <myuc:GenericTabs ID="LinkListTabs1" runat="server" Section="Groups" SelectedItem="edit" />
    <div class="wide-c left">
    <div class="formtable">
        <asp:FormView ID="FormView1" runat="server" Width="100%" CellPadding="0" DataKeyNames="GroupId" DefaultMode="Edit"
            DataSourceID="LinqDataSource1">
            <EditItemTemplate><br />
                <h2 class="w5">
                    <span class="nss ns-edit"></span>
                    <span class="iconlabel">编辑圈子信息</span>
                </h2>
                <div class="formtable">
                    <table>
                        <tr>
                            <td>
                                圈子类型:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="xmlCategory" DataTextField="name"
                                    DataValueField="name" SelectedValue='<%# Bind("GroupCategory") %>' Width="200px">
                                </asp:DropDownList>
                                <asp:XmlDataSource ID="xmlCategory" runat="server" DataFile="~/App_Data/GroupCategories.xml">
                                </asp:XmlDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                圈子名字:
                            </td>
                            <td>
                                <asp:TextBox Width="300" ID="TextBox1" runat="server" Text='<%# Bind("GroupName") %>'></asp:TextBox>
                                <%--<div class="nss ns-tick goodname" style="display:none;"></div>--%>
                                <asp:RequiredFieldValidator ValidationGroup="create" ID="RequiredFieldValidator1"
                                    ControlToValidate="TextBox1" Display="None" runat="server" ErrorMessage="圈子名称不能为空。"></asp:RequiredFieldValidator>
                                <cc:CustomValidatorCallOut ID="CustomValidatorCallOut1" runat="server" TargetControlID="RequiredFieldValidator1">
                                </cc:CustomValidatorCallOut>
                                <asp:CustomValidator ID="CustomValidator1" ClientValidationFunction="OtherGroupExists"
                                    ValidateEmptyText="false" runat="server" ErrorMessage="已经有相同名称的圈子。" ValidationGroup="create"
                                    ControlToValidate="TextBox1" Display="None"></asp:CustomValidator>
                                <cc:CustomValidatorCallOut ID="CustomValidatorCallOut2" runat="server" TargetControlID="CustomValidator1"
                                    PopupPosition="Right">
                                </cc:CustomValidatorCallOut>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                所在地区:
                            </td>
                            <td>
                                <myuc:ProvinceCityDropDownList runat="server" ID="ProvinceCityDropDownList1" SelectedProvince='<%#Bind("Province")%>' SelectedCity='<%#Bind("City") %>'
                                      />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                公开程度:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="xmlPrivacy" DataTextField="Text"
                                    DataValueField="Value" Width="200px" SelectedValue='<%# Bind("Privacy") %>'>
                                </asp:DropDownList>
                                <asp:XmlDataSource ID="xmlPrivacy" runat="server" DataFile="~/App_Data/GroupPrivacy.xml">
                                </asp:XmlDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                加入圈子须知:
                            </td>
                            <td>
                                <asp:TextBox runat="server" Width="300" ID="PrefaceTextBox" TextMode="MultiLine"
                                    Rows="3" Text='<%#Bind("Preface") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                圈子介绍:
                            </td>
                            <td>
                                <myuc:Editor ID="Editor1" runat="server" Width="300" Height="100" EditorType="Simple"
                                    Content='<%#Bind("Description") %>' />
                            </td>
                        </tr>
                    </table>
                    <div class="actionarea textfar">
                        <asp:LinkButton ID="LinkButton1" runat="server" CssClass="submitbutton" ValidationGroup="create"
                            CommandName="Update">确定</asp:LinkButton>
                    </div>
                </div>
            </EditItemTemplate>
        </asp:FormView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
            EnableUpdate="True" TableName="Sc_Groups" Where="GroupId == @GroupId">
            <SelectParameters>
                <asp:QueryStringParameter Name="GroupId" QueryStringField="id" />
                <asp:ProfileParameter Name="OwnerUserId" PropertyName="UserId" />
            </SelectParameters>
            <WhereParameters>
                <asp:QueryStringParameter DbType="Guid" Name="GroupId" QueryStringField="id" />
            </WhereParameters>
        </asp:LinqDataSource>
    </div>
    </div>
    <div class="wide-s ctn-p-t">
        <uc1:nav runat="server" />
    </div>
</asp:Content>
